/**
 * @author Tobias Boehm
 *
 * 22.06.2011
 */
package org.anddev.andengine.extension.tbsengine.gameobject;

/**
 * This is a class to represent special requirements for the production of a
 * specific unit. Instances of this class will be added to {@link UnitType}s.
 * 
 * 
 * @author Tobias Boehm
 *
 */
public class ProductionRequirement {

	public static enum RequirementType{OwnsUnit, ElapsedRounds};
	
	private final RequirementType mRequirementType;
	private final String mUnitToOwnType;
	private final Integer mMin;
	private final Integer mMax;
	
	public ProductionRequirement(final String pUnitToOwnType, final int pMinAmount){
	
		this(pUnitToOwnType, pMinAmount, null);
	}
	
	public ProductionRequirement(final String pUnitToOwnType, final int pMinAmount, final Integer pMaxAmount){
		
		this.mUnitToOwnType = pUnitToOwnType;
		
		this.mMin = pMinAmount;
		
		this.mMax = pMaxAmount;
		
		this.mRequirementType = RequirementType.OwnsUnit;
	}
	
	public ProductionRequirement(final int pElapsedRounds){
		
		this.mMin = pElapsedRounds;
		
		this.mRequirementType = RequirementType.ElapsedRounds;
		
		this.mUnitToOwnType = null;
		
		this.mMax = null;
	}
	
}
